package com.mitac.mcd.cs.mobiletracking.messageserver.util;

import java.util.Date;
import java.util.Random;

public class RandomId
{
    /**
         * 产生一个随机的字符串
         * 
         * @param 字符串长度 
         * @return
         */
        public static String getRandomString(int length) {
            String base = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
            Random random = new Random();
            StringBuffer sb = new StringBuffer();
            for (int i = 0; i < length; i++) {
                int number = random.nextInt(base.length());
                sb.append(base.charAt(number));
            }
            return sb.toString();
        }
        
        public static void main(String[] args) {
            BusinessUtil.aLogger.info((new Date()).getTime());
        }
}
